import React, { Component } from 'react'
import TabControl from './TabControl/TabControl';
// import './index.css';

export class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      currentIndex: 0,
      tabList: ['流行', '新款', '精选']
    }
  }
  changeHanle (index) {
    this.setState({
      currentIndex: index
    })
  }
  render () {
    const { tabList, currentIndex } = this.state;
    return (
      <div>
        <TabControl tabList={tabList} currentIndex={currentIndex} changeClick={(index) => this.changeHanle(index)}></TabControl>
        <div>{tabList[currentIndex]}</div>
      </div >
    )
  }
}

export default App